package com.dianqiu.base.action;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.dianqiu.batch.service.CrawlerService;
import com.opensymphony.xwork2.ActionSupport;

public class BatchBaseAction extends ActionSupport implements ServletRequestAware, ServletResponseAware, SessionAware{

	private static final long serialVersionUID = 1L;
	private HttpServletRequest request;
	private HttpServletResponse response;
	private SessionMap<String, Object> session;
	private CrawlerService sinaCrawlerService;
	@Override
	public void setSession(Map<String, Object> session) {
		this.session = ( SessionMap<String, Object>)session;
		
	}
	@Override
	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}
	@Override
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpServletRequest getRequest() {
		return request;
	}
	public HttpServletResponse getResponse() {
		return response;
	}
	public SessionMap<String, Object> getSession() {
		return session;
	}
	public CrawlerService getSinaCrawlerService() {
		return sinaCrawlerService;
	}
	@Resource
	public void setSinaCrawlerService(CrawlerService sinaCrawlerService) {
		this.sinaCrawlerService = sinaCrawlerService;
	}

}
